<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>供应商平台</title>
</head>
<body class="tob-wrap">
	<div th:replace="common/top"></div>
	<article class="container container-b7-manage clearfix">
		<div th:replace="common/left::side"></div>
		<section class="content">

			<h3 class="m-top-bar">
				<!--<img src="../images/temp/pic_30x30_01.jpg" alt=""/> <a href="#">HUAWEI
					Tech <icon class="icon-btn icon-btn-blue-close"></icon>
				</a>-->
			</h3>

			<div class="m-order-bar">
				<p>
					<strong>用户管理 </strong>
				</p>
			</div>


			<div class="m-order-info">
				<table width="100%" summay="" cellpadding="0" cellspacing="0">
					<tr>
						<td>
							<p>供应商：<span th:text="${user.tCompany.companyName}">百度在线网络技术有限公司</span></p>
							<p>缴费状况：
								<span th:if="${vendor.status eq 1}" th:text="待审核">这是描述这是描述这是描述这是描述...</span>
								<span th:if="${vendor.status eq 2}" th:text="潜在供应商">这是描述这是描述这是描述这是描述...</span>
								<span th:if="${vendor.status eq 3}" th:text="有效供应商">这是描述这是描述这是描述这是描述...</span>
								<span th:if="${vendor.status eq 4}" th:text="黑名单">这是描述这是描述这是描述这是描述...</span>
							</p>
						</td>
						<td>
							<p>
								供应商级别：<span th:text="${vendor.grade}">B</span>（<a href="#">可升级</a>,<a href="#">去缴费</a>）
							</p>
							<p>可用用户数：<span th:text="${vendor.usersLimitNum}">99999</span></p>
						</td>
						<td class="w150 txR"></td>
					</tr>
				</table>
			</div>


			<div class="m-table-sell">
				<div class="m-table-cont">
					<table width="100%" summay="" cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th>序号</th>
								<th>用户ID</th>
								<th>密码</th>
								<th>昵称</th>
								<th>联系方式</th>
								<th>岗位</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<tr th:each="vendorUser:${vendorUserList}">
								<td th:text="${vendorUserStat.count}">001</td>
								<td th:text="${vendorUser.tUser.username}">1234567890</td>
								<td>******</td>
								<td th:text="${vendorUser.tUser.realName}">felixmo</td>
								<td class="w200 txL">
									<p>手机：<span th:text="${vendorUser.tUser.mobilePhone}">13800138000</span></p>
									<p>邮箱：<span th:text="${vendorUser.tUser.email}">abcdefgh@baidu.com</span></p>
								</td>
								<td>销售</td>
								<td>
									<span th:if="${vendorUser.status eq 1}" th:text="已激活" style="color: green;">正常</span>
									<span th:if="${vendorUser.status eq 0}" th:text="未激活" style="color: black;">删除</span>
								</td>
								<td><a th:href="@{'/user/agree?uid=' + ${vendorUser.tUser.id}}" onclick="return confirm('确定执行此操作？')">
										<span th:if="${vendorUser.status eq 0}" th:text="激活" style="text-decoration: underline;">同意</span>
								</a>
								
								 <a th:if="${userType ne '3'}" th:href="@{'/user/delete?uid=' + ${vendorUser.tUser.id}}" onclick="return confirm('确定执行此操作？')">
								 	<span th:if="${vendorUser.status eq 1 and user.isCompanyAdmin eq 1}" style="color: red; text-decoration: underline;">删除</span>
								 </a> 
								 
								 <a href="#" style="display: none;">保存</a>
								</td>
							</tr>
							<!-- 
							<tr>
								<td>002</td>
								<td>1234567890</td>
								<td>felixmo</td>
								<td class="w200 txL">
									<p>手机：13800138000</p>
									<p>邮箱：abcdefgh@baidu.com</p>
								</td>
								<td>销售</td>
								<td>正常</td>
								<td><a href="#">同意</a> <span class="span-disable">删除</span>
									<a href="#">保存</a></td>
							</tr>-->
							<form th:action="@{/user/adduser}" th:object="${userObj}" method="post" th:method="post" name="addUserForm" >
							<div th:if="${#fields.hasErrors('*')}" style="color: red; text-align: center;">  
						          <span th:each="error:${#fields.errors('*')}"  
						              th:text="${error}" >  
						            Validation error  
						          </span>  
						    </div>
						    <div th:text="${errorMsg}" style="color: red; text-align: center;">  
						            Validation error  
						    </div>
							<tr th:if="${user.isCompanyAdmin eq 1}"> <!-- when true it will display -->
								<td><span style="display: none;">003</span></td>
								<td>
									<input class="w80 input" type="text" placeholder="请输入"
									value="" th:field="*{username}"/></td>
								<td>
									<input class="w80 input" type="text" placeholder="请输入"
									value="" th:field="*{password}"/></td>
								<td>
									<input class="w80 input" type="text" placeholder="请输入"
									value="" th:field="*{realName}"/></td>
								<td class="w200 txL"><input class="w200 input" type="text"
									placeholder="请输入手机号和邮箱，用逗号隔开" value="" th:field="*{mobilePhone}" style="padding-right: 6px;"/></td>
								<td><input class="w80 input" type="text" placeholder="请输入"
									value="" /></td>
								<td>
									<select th:field="*{isDelete}">
										<option value="1">有效</option>
									</select>
								</td>	
								<td><span class="span-disable" th:remove="all">同意</span> <span
									class="span-disable" th:remove="all">删除</span> 
									
									<a href="#" onclick="addUserForm.submit();">保存 </a>

									</td>
							</tr>
							</form>
						</tbody>
					</table>
				</div>
			</div>
		</section>
	</article>
</body>
<script data-main="../js/page/b1_supplier"
	src="../lib/requirejs/require.js"></script>
</html>